home *** CD-ROM | disk | FTP | other *** search
/ isnet Internet / Isnet Internet CD.iso / prog / hiz / 09 / 09.exe / adynware.exe / perl / lib / site / DBD / NullP.pm < prev    next >
Encoding:
Text File  |  1999-12-28  |  1.5 KB  |  88 lines

  1. {
  2.     package DBD::NullP;
  3.  
  4.     require DBI;
  5.  
  6.     @EXPORT = qw(); # Do NOT @EXPORT anything.
  7.  
  8.  
  9.     $drh = undef;    # holds driver handle once initialised
  10.     $err = 0;        # The $DBI::err value
  11.  
  12.     sub driver{
  13.     return $drh if $drh;
  14.     my($class, $attr) = @_;
  15.     $class .= "::dr";
  16.     ($drh) = DBI::_new_drh($class, {
  17.         'Name' => 'NullP',
  18.         'Version' => '$Revision: 1.1 $',
  19.         'Attribution' => 'DBD Example Null Perl stub by Tim Bunce',
  20.         }, [ qw'example implementors private data']);
  21.     $drh;
  22.     }
  23.  
  24.     1;
  25. }
  26.  
  27.  
  28. {   package DBD::NullP::dr; # ====== DRIVER ======
  29.     $imp_data_size = 0;
  30.     use strict;
  31.  
  32.     sub disconnect_all { }
  33.     sub DESTROY { undef }
  34. }
  35.  
  36.  
  37. {   package DBD::NullP::db; # ====== DATABASE ======
  38.     $imp_data_size = 0;
  39.     use strict;
  40.  
  41.     sub prepare {
  42.     my($dbh, $statement)= @_;
  43.  
  44.     my($outer, $sth) = DBI::_new_sth($dbh, {
  45.         'Statement'     => $statement,
  46.         }, [ qw'example implementors private data']);
  47.  
  48.     $outer;
  49.     }
  50.  
  51.     sub DESTROY { undef }
  52. }
  53.  
  54.  
  55. {   package DBD::NullP::st; # ====== STATEMENT ======
  56.     $imp_data_size = 0;
  57.     use strict;
  58.  
  59.     sub execute {
  60.     my($sth, $dir) = @_;
  61.     1;
  62.     }
  63.  
  64.     sub fetch {
  65.     my($sth) = @_;
  66.     $sth->finish;     # no more data so finish
  67.     return [];
  68.     }
  69.  
  70.     sub finish {
  71.     my($sth) = @_;
  72.     }
  73.  
  74.     sub FETCH {
  75.     my ($sth, $attrib) = @_;
  76.     return $sth->DBD::_::dr::FETCH($attrib);
  77.     }
  78.  
  79.     sub STORE {
  80.     my ($sth, $attrib, $value) = @_;
  81.     return $sth->DBD::_::dr::STORE($attrib, $value);
  82.     }
  83.  
  84.     sub DESTROY { undef }
  85. }
  86.  
  87. 1;
  88.